-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elastic Search 5 Indexing Performance Issue with product mapper #25452
Elastic Search 5 Indexing Performance Issue with product mapper #25452
Conversation
2.3 develop
…s, do not loop over all options
Hi @behnamshayani. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @ihor-sviziev, thank you for the review. |
@behnamshayani thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Fix static tests
✔️ QA Passed Should be created and run performance tests |
Hi @behnamshayani, thank you for your contribution! |
Description (*)
This PR fixes performance issue with huge catalog that have attributes that can have thousands of different options (in our case we have 23000 option for one and 3000-4000 for some others)
The original code for each product, iterates over all possible options to find corresponding label for a product's possible options values (so if a product has 10 option values out of 23000 options, the original code does 22990 extra loops and there is also use of
in_array
in each of them)The fix aims to build the attribute option array by the option values as key, so it can only iterate the product's option values (10 items) and use
isset
instead ofin_array
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
On a catalog with 1.2 Million product , an attribute with 23000 options and a couple with 3000-4000 and 4 websites the catalogsearch_fulltext took 12hours before the fix and 45min on local devbox after the fix.
Contribution checklist (*)